/* ============ 轮播容器 ============ */

.carousel-wrapper {
    position: relative;
    width: 100%;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 16:9 宽高比 */
    overflow: hidden;
}

/* ============ 轮播项 ============ */

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.active {
    opacity: 1;
    z-index: 10;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-title {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.carousel-description {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

/* ============ 控制按钮 ============ */

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 30;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 16px;
}

.carousel-next {
    right: 16px;
}

/* ============ 指示器 ============ */

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 30;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.7);
}

.carousel-indicator.active {
    background: white;
    width: 24px;
    border-radius: 5px;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .carousel-control {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .carousel-prev {
        left: 12px;
    }

    .carousel-next {
        right: 12px;
    }

    .carousel-title {
        font-size: 18px;
        bottom: 30px;
        left: 16px;
        right: 16px;
    }

    .carousel-description {
        font-size: 12px;
        bottom: 12px;
        left: 16px;
        right: 16px;
    }

    .carousel-indicators {
        bottom: 12px;
        gap: 6px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    .carousel-indicator.active {
        width: 20px;
    }
}

@media (max-width: 480px) {
    .carousel-control {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .carousel-prev {
        left: 8px;
    }

    .carousel-next {
        right: 8px;
    }

    .carousel-title {
        font-size: 16px;
        bottom: 24px;
        left: 12px;
        right: 12px;
    }

    .carousel-description {
        display: none;
    }

    .carousel-indicators {
        bottom: 8px;
        gap: 4px;
    }

    .carousel-indicator {
        width: 6px;
        height: 6px;
    }

    .carousel-indicator.active {
        width: 16px;
    }
}
